package com.lik888.web1.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lik888.web1.entity.HlepTable;
import com.lik888.web1.mapper.HlepTableMapper;
import com.lik888.web1.service.IHlepTableService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2025-11-10
 */
@Service
@RequiredArgsConstructor
public class HlepTableServiceImpl extends ServiceImpl<HlepTableMapper, HlepTable> implements IHlepTableService {
    private final HlepTableMapper hlepTableMapper;


    @Override
    public HlepTable PayAndSell() {
        HlepTable hlepTable = hlepTableMapper.selectOne(new LambdaQueryWrapper<HlepTable>().isNotNull(HlepTable::getHlepInfo));
        return hlepTable;
    }

    @Override
    public List<String> Selectcarousel() {
        List<HlepTable> hlepTables = hlepTableMapper.selectList(new LambdaQueryWrapper<HlepTable>().isNull(HlepTable::getHlepInfo));
        return hlepTables.stream().map(HlepTable::getHlepImg).toList();
    }
}
